<template>
  <div class="details">
    <el-container>
      <el-header>
        <Header></Header>
      </el-header>
      <el-main>
        <Main :id="id"></Main>
      </el-main>
      <el-footer>
        <Footer></Footer>
      </el-footer>
    </el-container>
  </div>
</template>

<script>
  import Footer from "../Home/components/Footer";
  import Main from "./components/Main";
  import Header from "./components/Header";

  export default {
    name: "Details",
    props: ['id'] /*获取url的id的值*/,
    components: {
      Header,
      Footer,
      Main
    },
    beforeRouteEnter(to, from, next){
      next(vm => {
        document.title = vm.$store.state.title + " - my blog"
      })
    }
  }
</script>

<style scoped>
  .el-main {
    color: #333;
    text-align: center;
  }

  .el-header {
    border-bottom: 1px solid #e6e6e6;
    box-shadow: 0 0 6px rgba(0, 0, 0, .04);
    z-index: 1000;
  }

  .el-footer {
    border-top: 1px solid #e6e6e6;
    line-height: 160px;
  }

  body > .el-container {
    margin-bottom: 40px;
  }
</style>
